|
Ubicación en el Menú |
---|
Dibujo → Herramientas Bézier → Cubic Curva Bézier |
Entornos de trabajo |
Borrador, Arquitectura |
Atajo de teclado por defecto |
Ninguno |
Introducido en versión |
0.19 |
Ver también |
Borrador BezCurva, Borrador BSpline |
El comando Borrador CubicBezCurva crea una Curva de Bézier de tercer grado (se requieren cuatro puntos).
La Curva de Bézier es una de las curvas más utilizadas en infografía. Este comando permite crear una spline continua formada por varios segmentos de Bézier de tercer grado, de forma similar a la herramienta Bézier de Inkscape. Una curva Bézier general de cualquier grado puede ser creada con el comando Borrador BezCurva.
Los comandos Borrador de BezCurva y Borrador de CubicBezCurve utilizan puntos de control para definir la posición y la curvatura de la spline. El comando Borrador BSpline, en cambio, especifica los puntos exactos por los que pasará la curva.
Spline formada por tres segmentos cúbicos de Bézier. El primer segmento está definido por cuatro puntos. Los segmentos posteriores reutilizan dos puntos del segmento anterior y, por tanto, sólo requieren dos puntos adicionales.
Ver también: Bandeja de borrador, Borrador Snap y Borrador Constreñido.
See Draft BezCurve.
See Draft BezCurve.
See also: Autogenerated API documentation and FreeCAD Scripting Basics.
See Draft BezCurve for general information. A cubic Bézier is created by passing the option degree=3
to makeBezCurve()
.
For each cubic Bézier segment four points must be used, of which the two extreme points indicate where the spline passes through, and the two intermediate points are control points.
3n + 1
or 3n
, where n
is the number of segments, for n >= 1
.Ejemplos de curvas de Bézier producidas utilizando 2, 3, 4, 5, 6, 7 y 8 puntos. Las líneas sólidas indican segmentos cúbicos de Bézier; las otras líneas son cuadráticas o lineales.
Ejemplo:
import FreeCAD as App
import Draft
doc = App.newDocument()
p1 = App.Vector(-3500, 0, 0)
p2 = App.Vector(-3000, 2000, 0)
p3 = App.Vector(-1100, 2000, 0)
p4 = App.Vector(0, 0, 0)
p5 = App.Vector(1500, -2000, 0)
p6 = App.Vector(3000, -1500, 0)
p7 = App.Vector(5000, 0, 0)
p8 = App.Vector(6000, 1500, 0)
rot = App.Rotation()
c1 = Draft.make_circle(100, placement=App.Placement(p1, rot), face=False)
c1.Label = "B1_E1"
c2 = Draft.make_circle(50, placement=App.Placement(p2, rot), face=True)
c2.Label = "B1_c1"
c3 = Draft.make_circle(50, placement=App.Placement(p3, rot), face=True)
c3.Label = "B1_c2"
c4 = Draft.make_circle(100, placement=App.Placement(p4, rot), face=False)
c4.Label = "B1_E2"
c5 = Draft.make_circle(50, placement=App.Placement(p5, rot), face=True)
c5.Label = "B2_c3"
c6 = Draft.make_circle(50, placement=App.Placement(p6, rot), face=True)
c6.Label = "B2_c4"
c7 = Draft.make_circle(100, placement=App.Placement(p7, rot), face=False)
c7.Label = "B2_E3"
c8 = Draft.make_circle(50, placement=App.Placement(p8, rot), face=True)
c8.Label = "B3_c5"
doc.recompute()
B1 = Draft.make_bezcurve([p1, p2], degree=3)
B1.Label = "B_lin"
B1.ViewObject.DrawStyle = "Dashed"
B2 = Draft.make_bezcurve([p1, p2, p3], degree=3)
B2.Label = "B_quad"
B2.ViewObject.DrawStyle = "Dotted"
B3 = Draft.make_bezcurve([p1, p2, p3, p4], degree=3)
B3.Label = "B_cub"
B3.ViewObject.LineWidth = 4
B4 = Draft.make_bezcurve([p1, p2, p3, p4, p5], degree=3)
B4.Label = "B_cub+lin"
B4.ViewObject.DrawStyle = "Dashed"
B5 = Draft.make_bezcurve([p1, p2, p3, p4, p5, p6], degree=3)
B5.Label = "B_cub+quad"
B5.ViewObject.DrawStyle = "Dotted"
B6 = Draft.make_bezcurve([p1, p2, p3, p4, p5, p6, p7], degree=3)
B6.Label = "B_cub+cub"
B6.ViewObject.LineWidth = 2
B7 = Draft.make_bezcurve([p1, p2, p3, p4, p5, p6, p7, p8], degree=3)
B7.Label = "B_cub+cub+lin"
B7.ViewObject.DrawStyle = "Dashed"
doc.recompute()